<template>
	<!-- <div
		class="header"
		v-if="insuranceWeb"
		:style="{ backgroundImage: `url(${insuranceWeb.url})` }"
	/> -->
	<div class="body" v-if="insuranceWeb">
		<div class="title">{{ insuranceWeb.name }}</div>

		<!-- <div class="sec-link"></div> -->
		<!-- <div class="sec-ttl">
			<span>公司官网</span>
		</div>
		<div class="sec-con">
			<a
				:href="insuranceWeb.address"
				style="
					text-decoration: underline;
					color: blue;
					padding-bottom: 24rem;
					display: block;
				"
				>{{ insuranceWeb.address }}</a
			>
		</div> -->
		<div class="sec-ttl">
			<span>公司介绍</span>
		</div>

		<div class="sec-con">
			<p v-for="p in getIntroduction(insuranceWeb.introduction)">
				{{ p }}
			</p>
		</div>
		<!-- <textarea type="textarea" v-model="textarea" /> -->
	</div>
</template>

<script>
import { defineComponent } from 'vue'
import { exposeInfo } from '@/api'

import { showLoadingToast, closeToast } from 'vant'
export default defineComponent({
	setup(props, { emit, slots, attrs }) {},
	data() {
		return {
			list: [],
			insuranceWeb: null
		}
	},
	computed: {
		// 机构类型，用于列表传参
		id() {
			return this.$route.query.id
		}
	},
	watch: {},
	created() {
		// 获取列表
		this.getDetail()
	},
	mounted() {},
	methods: {
		getDetail() {
			showLoadingToast({
				message: '正在加载'
			})
			exposeInfo(this.id)
				.then((res) => {
					this.insuranceWeb = res.insuranceWeb
				})
				.finally(closeToast)
		},
		getIntroduction(val) {
			return val.split('\n')
		}
	},
	components: {}
})
</script>

<style lang="scss" scoped="scoped">
// .header {
// 	height: 260rem;
// 	// background-image: url('@/assets/street.png');
// 	background-position: center;
// 	background-size: contain;
// 	background-repeat: no-repeat;
// 	background-color: #fff;
// 	position: fixed;
// 	top: 0;
// 	left: 0;
// 	right: 0;
// }

.body {
	position: relative;
	// border-radius: 40rem 40rem 0 0;
	// margin-top: 260rem;
	min-height: calc(100vh - 260rem);
	padding: 40rem $space_4;
	background-image: -webkit-linear-gradient(top, #e6f6ff, #fff 100rem),
		-webkit-linear-gradient(top, #e6f6ff, #fff 100rem);
	.title {
		padding: $space_1 0;
		padding-bottom: $space_5;
		font-size: $font_large;
		text-align: center;
	}
	.sec-link {
	}
	.sec-ttl {
		font-size: $font_medium;
		padding: $space_2;
		background-image: -webkit-linear-gradient(left, #e6f6ff, #fff 200rem);
		display: flex;
		justify-content: space-between;
		margin-bottom: $space_2;
	}

	.sec-con {
		line-height: 1.4;
		font-size: $font_medium;
		color: #616161;
		p {
			text-indent: 2em;
			margin-bottom: 0.5em;
		}
	}
}
</style>
